package command

import (
	"fmt"
	"github.com/spf13/cobra"
	"os"
)

var RootCmd = &cobra.Command{
	Use:   "mytool",
	Short: "A command-line tool for managing files and users in Linux",
	Long: `A longer description that spans multiple lines and likely contains
examples and usage of using your tool. For example:

mytool createfile newfile.txt
mytool deletefile newfile.txt
mytool adduser john
mytool deleteuser john`,
	Run: func(cmd *cobra.Command, args []string) {
		// Do nothing by default
	},
}

func init() {
	RootCmd.AddCommand(createfileCmd)
	RootCmd.AddCommand(deletefileCmd)
	RootCmd.AddCommand(adduserCmd)
	RootCmd.AddCommand(deleteuserCmd)
}

func Execute() {
	if err := RootCmd.Execute(); err != nil {
		fmt.Println(err)
		os.Exit(1)
	}
}
